<%layout("../layout.html"){%>
<div class="line-middle margin-top margin-bottom">
	<div class="xm12">
		<%if(has(msg)){%>
		<div class="alert alert-danger" role="alert">${msg}</div>
		<%}%>
		<form role="form" action="${BASE_PATH}/admin/article/pubAction"
			method="post">
			<div class="form-group">
				<div class="label">
					<label for="artTitle">标题</label>
				</div>
				<div class="field">
					<input type="text" class="input" id="artTitle" name="artTitle"
						size="30" autocomplete="off" placeholder="请输入标题"
						value="<%if(has(artTitle)){%>${artTitle}<%}%>" />
				</div>
			</div>
			<div class="form-group">
				<div class="label">
					<label for="cate">分类</label>
				</div>
				<div class="field">
					<select class="input" name="cate" id="cate"> <% for(c in
						cateLists){ %>
						<option value="${c.id}"<%if(has(cate) && cate ==
							c.id+""){%>selected="selected"<%}%>>${c.name}</option> <% } %>
					</select>
				</div>
			</div>
			<div class="form-group">
				<div class="label">
					<label for="tags">标签</label>
				</div>
				<div class="field">
					<input type="text" class="input" id="tags" name="tags" size="30"
						autocomplete="off" placeholder="请输入标签,用英文逗号分割"
						value="<%if(has(tags)){%>${tags}<%}%>" />
				</div>
			</div>

			<div class="form-group">
				<div class="label">
					<label for="contents">正文</label>
				</div>
				<div class="field">
					<textarea class="input" id="contents" name="contents" cols="100"
						rows="5" style="width: 100%; height: 300px; visibility: hidden;"><%if(has(contents)){%>${contents}<%}%></textarea>
				</div>
			</div>

			<div class="form-button">
				<button class="button" type="submit">发布</button>
			</div>
		</form>
	</div>
</div>


<script charset="utf-8" src="${BASE_PATH}/js/kindeditor-all.js"></script>
<script charset="utf-8" src="${BASE_PATH}/lang/zh_CN.js"></script>
<script charset="utf-8" src="${BASE_PATH}/plugins/code/prettify.js"></script>
<script>
	KindEditor.ready(function(K) {
		var editor1 = K.create('textarea[name="contents"]', {
			uploadJson : '${BASE_PATH}/admin/editor/index',
			fileManagerJson : '${BASE_PATH}/admin/editor/fileManager',
			allowFileManager : true
		});
		prettyPrint();
	});

	$(document).ready(function(){
		setInterval("startRequest()",1000*60*5);
	});
	function startRequest()
    {
		$.get("${BASE_PATH}/admin/article/holdOnline");
    }
</script>
<%}%>
